package com.credit.management.system.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.credit.management.system.custom.dao.CSyroleauthorityMapper;
import com.credit.management.system.generator.dao.SyroleauthorityMapper;
import com.credit.management.system.model.Syroleauthority;
import com.credit.management.system.service.ISyroleauthorityService;
@Service
public class SyroleauthorityService implements ISyroleauthorityService {
	@Autowired
	private SyroleauthorityMapper syroleauthorityMapper;
	@Autowired
	private CSyroleauthorityMapper cSyroleauthorityMapper;
	
	/**
	 *根据id删除
	 */
	@Override
	public int deleteByPrimaryKey(Integer id) {
		
		return syroleauthorityMapper.deleteByPrimaryKey(id);
	}
	
	/**
	 * 添加
	 */
	@Override
	public int insertSelective(Syroleauthority record) {
		
		return syroleauthorityMapper.insertSelective(record);
	}
	
	/**
	 * 根据id查询
	 */
	@Override
	public Syroleauthority selectByPrimaryKey(Integer id) {
		
		return syroleauthorityMapper.selectByPrimaryKey(id);
	}
	
	/**
	 * 根据id修改（全修）
	 */
	@Override
	public int updateByPrimaryKeySelective(Syroleauthority record) {
		
		return syroleauthorityMapper.updateByPrimaryKeySelective(record);
	}
	
	/**
	 * 修改（单修）
	 */
	@Override
	public int updateByPrimaryKey(Syroleauthority record) {
		
		return syroleauthorityMapper.updateByPrimaryKey(record);
	}
	
	/**
	 * 删除角色具有的权限
	 */
	@Override
	public int deleteRolePermissionsByRoleId(Integer roleid) {
		
		return cSyroleauthorityMapper.deleteRolePermissionsByRoleId(roleid);
	}
}
